package br.com.infocruz.seam.crm.util;

import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

	
public class PaginatedArrayList<T> implements PaginatedList<T>, Serializable {
	/**
	 * 
	 */
	public static final long serialVersionUID = -5151336068215915576L;
	
	private List<T> resultList;
	Pagination pagination;
	
	public PaginatedArrayList() {
	}	
	
	public PaginatedArrayList(List<T> resultList, Pagination pagingInfo) {
		super();
		this.resultList = resultList;
		this.pagination = pagingInfo;
	}
	
	public Pagination getPagination() {
		return pagination;
	}

	public void setPagination(Pagination pagingInfo) {
		this.pagination = pagingInfo;
	}	

	public int getItemsCount() {
		return pagination.getItemsCount();
	}

	public int getPage() {
		return pagination.getPage();
	}

	public int getPageFirstItem() {
		return pagination.getPageFirstItem();
	}

	public int getPageLastItem() {
		return pagination.getPageLastItem();
	}

	public int getPageSize() {
		return pagination.getPageSize();
	}

	public boolean isHasNextPage() {
		return pagination.isHasNextPage();
	}

	public boolean isHasPreviousPage() {
		return pagination.isHasPreviousPage();
	}

	public void nextPage() {
		pagination.nextPage();
	}

	public void previousPage() {
		pagination.previousPage();
	}

	public void setItemsCount(int itemsCount) {
		pagination.setItemsCount(itemsCount);
	}

	public void setPage(int page) {
		pagination.setPage(page);
	}

	public void setPageSize(int pageSize) {
		pagination.setPageSize(pageSize);
	}

	public void add(int index, T element) {
		resultList.add(index, element);
	}

	public boolean add(T e) {
		return resultList.add(e);
	}

	public boolean addAll(Collection<? extends T> c) {
		return resultList.addAll(c);
	}

	public boolean addAll(int index, Collection<? extends T> c) {
		return resultList.addAll(index, c);
	}

	public void clear() {
		resultList.clear();
	}

	public boolean contains(Object o) {
		return resultList.contains(o);
	}

	public boolean containsAll(Collection<?> c) {
		return resultList.containsAll(c);
	}

	public T get(int index) {
		return resultList.get(index);
	}

	public int indexOf(Object o) {
		return resultList.indexOf(o);
	}

	public boolean isEmpty() {
		return resultList.isEmpty();
	}

	public Iterator<T> iterator() {
		return resultList.iterator();
	}

	public int lastIndexOf(Object o) {
		return resultList.lastIndexOf(o);
	}

	public ListIterator<T> listIterator() {
		return resultList.listIterator();
	}

	public ListIterator<T> listIterator(int index) {
		return resultList.listIterator(index);
	}

	public T remove(int index) {
		return resultList.remove(index);
	}

	public boolean remove(Object o) {
		return resultList.remove(o);
	}

	public boolean removeAll(Collection<?> c) {
		return resultList.removeAll(c);
	}

	public boolean retainAll(Collection<?> c) {
		return resultList.retainAll(c);
	}

	public T set(int index, T element) {
		return resultList.set(index, element);
	}

	public int size() {
		return resultList.size();
	}

	public List<T> subList(int fromIndex, int toIndex) {
		return resultList.subList(fromIndex, toIndex);
	}

	public Object[] toArray() {
		return resultList.toArray();
	}

	public <T> T[] toArray(T[] a) {
		return resultList.toArray(a);
	}

}
